[dynamic control] Add delegating sampler implementation#2607
Merged
jaydeluca merged 12 commits intoopen-telemetry:mainfrom Feb 12, 2026
Merged
[dynamic control] Add delegating sampler implementation#2607jaydeluca merged 12 commits intoopen-telemetry:mainfrom
jaydeluca merged 12 commits intoopen-telemetry:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a DelegatingSampler implementation that enables dynamic configuration of sampling behavior at runtime. The delegating sampler wraps any OpenTelemetry sampler and allows it to be replaced during application execution without requiring a restart.
Changes:
- Adds a new
DelegatingSamplerclass that implements theSamplerinterface - Uses
AtomicReferenceto safely manage the delegate sampler in concurrent environments - Provides methods to update the delegate sampler at runtime
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
…/sampler/DelegatingSampler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/sampler/DelegatingSampler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/sampler/DelegatingSampler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/sampler/DelegatingSampler.java
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
…/sampler/DelegatingSampler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
LikeTheSalad
approved these changes
Feb 11, 2026
trask
reviewed
Feb 11, 2026
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/sampler/DelegatingSampler.java
Outdated
Show resolved
Hide resolved
jaydeluca
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per #2546
The delegating sampler makes support for any sampler fully dynamic, allowing it to be reconfigured or even fully replaced at runtime
A full working implementation of the open-telemetry/opentelemetry-specification#4738 is here in this branch